package com.huaweicloud.sdk.ges.v2.model;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;

import java.util.Objects;
import java.util.function.Consumer;

/**
 * 创建元数据请求体
 */
public class CreateMetadataReq {

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty(value = "metadata_path")

    private String metadataPath;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty(value = "name")

    private String name;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty(value = "description")

    private String description;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty(value = "is_overwrite")

    private Boolean isOverwrite;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty(value = "ges_metadata")

    private CreateMetadataReqGesMetadata gesMetadata;

    public CreateMetadataReq withMetadataPath(String metadataPath) {
        this.metadataPath = metadataPath;
        return this;
    }

    /**
     * 元数据存储地址。
     * @return metadataPath
     */
    public String getMetadataPath() {
        return metadataPath;
    }

    public void setMetadataPath(String metadataPath) {
        this.metadataPath = metadataPath;
    }

    public CreateMetadataReq withName(String name) {
        this.name = name;
        return this;
    }

    /**
     * 元数据的名字，限制为1-64个字符，且只能包含字母，数字或下划线。
     * @return name
     */
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public CreateMetadataReq withDescription(String description) {
        this.description = description;
        return this;
    }

    /**
     * 对元数据的描述。
     * @return description
     */
    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public CreateMetadataReq withIsOverwrite(Boolean isOverwrite) {
        this.isOverwrite = isOverwrite;
        return this;
    }

    /**
     * 是否覆盖文件。
     * @return isOverwrite
     */
    public Boolean getIsOverwrite() {
        return isOverwrite;
    }

    public void setIsOverwrite(Boolean isOverwrite) {
        this.isOverwrite = isOverwrite;
    }

    public CreateMetadataReq withGesMetadata(CreateMetadataReqGesMetadata gesMetadata) {
        this.gesMetadata = gesMetadata;
        return this;
    }

    public CreateMetadataReq withGesMetadata(Consumer<CreateMetadataReqGesMetadata> gesMetadataSetter) {
        if (this.gesMetadata == null) {
            this.gesMetadata = new CreateMetadataReqGesMetadata();
            gesMetadataSetter.accept(this.gesMetadata);
        }

        return this;
    }

    /**
     * Get gesMetadata
     * @return gesMetadata
     */
    public CreateMetadataReqGesMetadata getGesMetadata() {
        return gesMetadata;
    }

    public void setGesMetadata(CreateMetadataReqGesMetadata gesMetadata) {
        this.gesMetadata = gesMetadata;
    }

    @Override
    public boolean equals(java.lang.Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null || getClass() != obj.getClass()) {
            return false;
        }
        CreateMetadataReq that = (CreateMetadataReq) obj;
        return Objects.equals(this.metadataPath, that.metadataPath) && Objects.equals(this.name, that.name)
            && Objects.equals(this.description, that.description) && Objects.equals(this.isOverwrite, that.isOverwrite)
            && Objects.equals(this.gesMetadata, that.gesMetadata);
    }

    @Override
    public int hashCode() {
        return Objects.hash(metadataPath, name, description, isOverwrite, gesMetadata);
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("class CreateMetadataReq {\n");
        sb.append("    metadataPath: ").append(toIndentedString(metadataPath)).append("\n");
        sb.append("    name: ").append(toIndentedString(name)).append("\n");
        sb.append("    description: ").append(toIndentedString(description)).append("\n");
        sb.append("    isOverwrite: ").append(toIndentedString(isOverwrite)).append("\n");
        sb.append("    gesMetadata: ").append(toIndentedString(gesMetadata)).append("\n");
        sb.append("}");
        return sb.toString();
    }

    /**
     * Convert the given object to string with each line indented by 4 spaces
     * (except the first line).
     */
    private String toIndentedString(java.lang.Object o) {
        if (o == null) {
            return "null";
        }
        return o.toString().replace("\n", "\n    ");
    }

}
